package org.come.Jpanel;

import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

import com.tool.btn.FormsOnOffBtn;
import com.tool.tcpimg.UIUtils;

public class TryOntxJpanel extends JPanel {

	private ShowImageJpanel[] imageJpanels = new ShowImageJpanel[3]; // 展示已穿戴上去的特效信息

	public TryOntxJpanel() {
		this.setPreferredSize(new Dimension(400, 206));
		this.setLayout(null);
		this.setBackground(UIUtils.Color_BACK);
		// 关闭按钮事件
		FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/number/b8/off.png", 1, 51);
		offBtn.setBounds(383, 2, 20, 25);
		this.add(offBtn);

		for (int i = 0; i < 3; i++) {
			imageJpanels[i] = new ShowImageJpanel();
			imageJpanels[i].setBounds(50 + i * 120, 45, 110, 155);
			this.add(imageJpanels[i]);
		}
	}

	private ImageIcon icon;

	@Override
	protected void paintComponent(Graphics g) {
		// TODO Auto-generated method stub
		super.paintComponent(g);
		if (icon == null) {
			icon = new ImageIcon("inkImg/number/b8/preview.png");
		}
		g.drawImage(icon.getImage(), 0, 0, 400, 206, this);
	}

	public ShowImageJpanel[] getImageJpanels() {
		return imageJpanels;
	}

	public void setImageJpanels(ShowImageJpanel[] imageJpanels) {
		this.imageJpanels = imageJpanels;
	}
}
